#define _CRT_SECURE_NO_WARNINGS 1


#include <stdio.h>
#include <math.h>

//int x = 5, y = 7;
//void swap()
//{
//	int z;
//	z = x;
//	x = y;
//	y = z;
//} 
//int main()
//{
//	char c2[] = { '\x10', '\xa', '\8' };
//	double x[5] = { 2.0, 4.0, 6.0, 8.0, 10.0 };
//	char c1[] = { '1','2','3','4','5' };
//	return 0;
//}

int* printNumbers(int n, int* returnSize)
{
    int j = 0;
    for (int i = 1; i <= pow(10, n) - 1.0; i++)
    {
        *(returnSize+j) = i;
        j++;
    }
    return returnSize;
}

int main()
{
    int n;
    scanf("%d", &n);
    int ch[10000] = { 0 };
    printNumbers(n, &ch);
    for (int i = 1; i <= pow(10, n) - 1.0; i++)
        printf("%d ", ch[i]);
	return 0;
}

int* printNumbers(int n, int* returnSize) {
    int a = 1;
    int arr[1000001];
    for (int j = n; j > 0; j--)
    {
        a *= 10;
    }
    for (int i = a - 1; i >= 0; i--)
    {
        arr[i - 1] = i;
        (*returnSize)++;
    }
    (*returnSize)--;
    return arr;
}
